package edu.hbsi.demo7;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Set;

public class Test {
    public static void main(String[] args) {
        ArrayList<Student> arr1=new ArrayList<>();
        arr1.add(new Student(18,"张晓"));
        arr1.add(new Student(20,"王娜娜"));

        ArrayList<Student> arr2=new ArrayList<>();
        arr1.add(new Student(18,"郑六六"));
        arr1.add(new Student(20,"赵七七"));

        HashMap<String,ArrayList<Student>> hashMap1=new HashMap<>();
        hashMap1.put("java-01",arr1);
        hashMap1.put("java-02",arr2);

        ArrayList<Student> arr3=new ArrayList<>();
        arr1.add(new Student(18,"lii"));
        arr1.add(new Student(20,"jack"));

        ArrayList<Student> arr4=new ArrayList<>();
        arr1.add(new Student(18,"Rose"));
        arr1.add(new Student(20,"Merry"));

        HashMap<String,ArrayList<Student>> hashMap2=new HashMap<>();
        hashMap2.put("国际-01",arr1);
        hashMap2.put("国际-02",arr2);

        HashMap<String,HashMap<String,ArrayList<Student>>> hashMap=new HashMap<>();
        hashMap.put("软件工程系",hashMap1);
        hashMap.put("国际合作部",hashMap2);
        //遍历hashMap
        //System.out.println(hashMap);

        Set<String> xbSet=hashMap.keySet();
        for(String xbName:xbSet){
            System.out.println(xbName);
            HashMap<String,ArrayList<Student>> bjMap=hashMap.get(xbName);
            //System.out.println(bjMap);
            Set<String> bjSet=bjMap.keySet();
            for(String bjName:bjSet){
                System.out.println("\t"+bjName);
                ArrayList<Student> slist=bjMap.get(bjName);
                //System.out.println("\t\t"+slist);
                for(Student s:slist){
                    System.out.println("\t\t"+s.toString());
                }
            }
        }
    }
}
